/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * frmHome.java
 *
 * Created on Jan 26, 2012, 7:47:42 AM
 */

package SIMRS.Apotek.view;

import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JOptionPane;
import usu.widget.Form;

/**
 *
 * @author Joe
 */
public class frmHome extends Form {

    /** Creates new form frmHome */
    public frmHome() {
        initComponents();
        setIconImage(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/icon.png")).getImage());
    }
    
    

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        pnlHome1 = new SIMRS.Apotek.widget.PnlHome();
        jMenuBar1 = new javax.swing.JMenuBar();
        mnFile = new javax.swing.JMenu();
        mnItemLogin = new javax.swing.JMenuItem();
        mnItemLogout = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        mnItemKeluar = new javax.swing.JMenuItem();
        mnDataMaster = new javax.swing.JMenu();
        jMenu7 = new javax.swing.JMenu();
        mnItemDataBarang = new javax.swing.JMenuItem();
        mnItemJenisBarang = new javax.swing.JMenuItem();
        jSeparator2 = new javax.swing.JPopupMenu.Separator();
        mnItemSatuanBesar = new javax.swing.JMenuItem();
        mnItemSatuanKecil = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        mnItemStokBarang = new javax.swing.JMenuItem();
        mnTransaksi = new javax.swing.JMenu();
        mnItemDataPasien = new javax.swing.JMenuItem();
        jMenu5 = new javax.swing.JMenu();
        mnItemResepKaryawan = new javax.swing.JMenuItem();
        mnItemResepLuar = new javax.swing.JMenuItem();
        mnItemResepPasien = new javax.swing.JMenuItem();
        jMenu6 = new javax.swing.JMenu();
        mnItemPemesanan = new javax.swing.JMenuItem();
        mnItemPenerimaan = new javax.swing.JMenuItem();
        mnItemPengirimanBarang = new javax.swing.JMenuItem();
        mnInformasi = new javax.swing.JMenu();
        mnItemInfoPemesanan = new javax.swing.JMenuItem();
        mnItemInfoPenerimaan = new javax.swing.JMenuItem();
        mnItemInfoPengiriman = new javax.swing.JMenuItem();
        mnItemInfoResepKaryawan = new javax.swing.JMenuItem();
        mnInfoResepLuar = new javax.swing.JMenuItem();
        mnBantuan = new javax.swing.JMenu();
        mnItemTentangProgram = new javax.swing.JMenuItem();
        mnItemBantuanProgram = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle(".:: RSIA Buah Hati");
        setAnimationHide(usu.widget.constan.Animation.HIDE_TO_BOTTOM);
        setAnimationShow(usu.widget.constan.Animation.SHOW_FROM_RIGHT);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });
        getContentPane().add(pnlHome1, java.awt.BorderLayout.CENTER);

        mnFile.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/File.png"))); // NOI18N
        mnFile.setText("File");

        mnItemLogin.setText("Login");
        mnItemLogin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemLoginActionPerformed(evt);
            }
        });
        mnFile.add(mnItemLogin);

        mnItemLogout.setText("Logout");
        mnItemLogout.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemLogoutActionPerformed(evt);
            }
        });
        mnFile.add(mnItemLogout);
        mnFile.add(jSeparator1);

        mnItemKeluar.setText("Keluar ");
        mnItemKeluar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemKeluarActionPerformed(evt);
            }
        });
        mnFile.add(mnItemKeluar);

        jMenuBar1.add(mnFile);

        mnDataMaster.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/Master.png"))); // NOI18N
        mnDataMaster.setText("Data Master");

        jMenu7.setText("Master Barang");

        mnItemDataBarang.setText("Data Barang");
        mnItemDataBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemDataBarangActionPerformed(evt);
            }
        });
        jMenu7.add(mnItemDataBarang);

        mnItemJenisBarang.setText("Jenis Barang");
        mnItemJenisBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemJenisBarangActionPerformed(evt);
            }
        });
        jMenu7.add(mnItemJenisBarang);
        jMenu7.add(jSeparator2);

        mnItemSatuanBesar.setText("Satuan Besar");
        mnItemSatuanBesar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemSatuanBesarActionPerformed(evt);
            }
        });
        jMenu7.add(mnItemSatuanBesar);

        mnItemSatuanKecil.setText("Satuan Kecil");
        mnItemSatuanKecil.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemSatuanKecilActionPerformed(evt);
            }
        });
        jMenu7.add(mnItemSatuanKecil);
        jMenu7.add(jSeparator3);

        mnItemStokBarang.setText("Stock Barang");
        mnItemStokBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemStokBarangActionPerformed(evt);
            }
        });
        jMenu7.add(mnItemStokBarang);

        mnDataMaster.add(jMenu7);

        jMenuBar1.add(mnDataMaster);

        mnTransaksi.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/Modul.png"))); // NOI18N
        mnTransaksi.setText("Transaksi");

        mnItemDataPasien.setText("Data Pasien");
        mnItemDataPasien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemDataPasienActionPerformed(evt);
            }
        });
        mnTransaksi.add(mnItemDataPasien);

        jMenu5.setText("Pelayanan Resep");

        mnItemResepKaryawan.setText("Karyawan");
        mnItemResepKaryawan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemResepKaryawanActionPerformed(evt);
            }
        });
        jMenu5.add(mnItemResepKaryawan);

        mnItemResepLuar.setText("Resep Luar");
        mnItemResepLuar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemResepLuarActionPerformed(evt);
            }
        });
        jMenu5.add(mnItemResepLuar);

        mnItemResepPasien.setText("Pasien");
        mnItemResepPasien.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemResepPasienActionPerformed(evt);
            }
        });
        jMenu5.add(mnItemResepPasien);

        mnTransaksi.add(jMenu5);

        jMenu6.setText("Supplier");

        mnItemPemesanan.setText("Pemesanan Barang");
        mnItemPemesanan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemPemesananActionPerformed(evt);
            }
        });
        jMenu6.add(mnItemPemesanan);

        mnItemPenerimaan.setText("Penerimaan Barang");
        mnItemPenerimaan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemPenerimaanActionPerformed(evt);
            }
        });
        jMenu6.add(mnItemPenerimaan);

        mnTransaksi.add(jMenu6);

        mnItemPengirimanBarang.setText("Pengiriman Barang ke Ruangan");
        mnItemPengirimanBarang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemPengirimanBarangActionPerformed(evt);
            }
        });
        mnTransaksi.add(mnItemPengirimanBarang);

        jMenuBar1.add(mnTransaksi);

        mnInformasi.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/ADCReferenceLibraryIcon.png"))); // NOI18N
        mnInformasi.setText("Informasi");

        mnItemInfoPemesanan.setText("Pemesanan Barang");
        mnItemInfoPemesanan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemInfoPemesananActionPerformed(evt);
            }
        });
        mnInformasi.add(mnItemInfoPemesanan);

        mnItemInfoPenerimaan.setText("Penerimaan Barang");
        mnItemInfoPenerimaan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemInfoPenerimaanActionPerformed(evt);
            }
        });
        mnInformasi.add(mnItemInfoPenerimaan);

        mnItemInfoPengiriman.setText("Pengiriman Barang Ke Ruangan");
        mnItemInfoPengiriman.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemInfoPengirimanActionPerformed(evt);
            }
        });
        mnInformasi.add(mnItemInfoPengiriman);

        mnItemInfoResepKaryawan.setText("Resep Karyawan");
        mnItemInfoResepKaryawan.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnItemInfoResepKaryawanActionPerformed(evt);
            }
        });
        mnInformasi.add(mnItemInfoResepKaryawan);

        mnInfoResepLuar.setText("Resep Luar");
        mnInfoResepLuar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mnInfoResepLuarActionPerformed(evt);
            }
        });
        mnInformasi.add(mnInfoResepLuar);

        jMenuBar1.add(mnInformasi);

        mnBantuan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/SIMRS/Apotek/gambar/Help.png"))); // NOI18N
        mnBantuan.setText("Bantuan");

        mnItemTentangProgram.setText("Tentang Program");
        mnBantuan.add(mnItemTentangProgram);

        mnItemBantuanProgram.setText("Bantuan Program");
        mnBantuan.add(mnItemBantuanProgram);

        jMenuBar1.add(mnBantuan);

        setJMenuBar(jMenuBar1);
    }// </editor-fold>//GEN-END:initComponents

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
        Dimension layar = Toolkit.getDefaultToolkit().getScreenSize();
        this.setSize(layar);
    }//GEN-LAST:event_formWindowActivated

    private void mnItemDataPasienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemDataPasienActionPerformed
        frmDaftarPasienRumahSakit pasien = new frmDaftarPasienRumahSakit();
        pasien.setVisible(true);
    }//GEN-LAST:event_mnItemDataPasienActionPerformed

    private void mnItemKeluarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemKeluarActionPerformed
    int jawab = JOptionPane.showConfirmDialog(this, "Anda yakin mau keluar ?" ,".:: Konfirmasi",JOptionPane.YES_NO_OPTION );
    if (jawab == JOptionPane.YES_OPTION){
        System.exit(0);
        
    }
    }//GEN-LAST:event_mnItemKeluarActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        int jawab = JOptionPane.showConfirmDialog(this, "Anda yakin mau keluar ?" ,".:: Konfirmasi",JOptionPane.YES_NO_OPTION );
    if (jawab == JOptionPane.YES_OPTION){
        dispose();
        this.setVisible(false);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
        exit();
    }
    }//GEN-LAST:event_formWindowClosing

    private void mnItemInfoPemesananActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemInfoPemesananActionPerformed
           frmInformasiPemesananBarangKeSupplier frmpsnsup = new frmInformasiPemesananBarangKeSupplier();
           frmpsnsup.setVisible(true);
    }//GEN-LAST:event_mnItemInfoPemesananActionPerformed

    private void mnItemInfoPenerimaanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemInfoPenerimaanActionPerformed
           frmInformasiPenerimaanBarangSupplier frmtrimassup = new frmInformasiPenerimaanBarangSupplier();
           frmtrimassup.setVisible(true);
    }//GEN-LAST:event_mnItemInfoPenerimaanActionPerformed

private void mnItemLoginActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemLoginActionPerformed
// TODO add your handling code here:
    mnItemLogoutActionPerformed(evt);
    frmLogin frmlogin = new frmLogin();
    frmlogin.setVisible(true);
}//GEN-LAST:event_mnItemLoginActionPerformed

private void mnItemDataBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemDataBarangActionPerformed
// TODO add your handling code here:
    frmMasterBarang frmmasterbarang = new frmMasterBarang();
    frmmasterbarang.setVisible(true);
}//GEN-LAST:event_mnItemDataBarangActionPerformed

private void mnItemJenisBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemJenisBarangActionPerformed
// TODO add your handling code here:
    frmJenisBarang frmjenisbarang = new frmJenisBarang();
    frmjenisbarang.setVisible(true);
}//GEN-LAST:event_mnItemJenisBarangActionPerformed

private void mnItemSatuanBesarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemSatuanBesarActionPerformed
// TODO add your handling code here:
    frmSatuanBesar frmsatuanbesar = new frmSatuanBesar();
    frmsatuanbesar.setVisible(true);
}//GEN-LAST:event_mnItemSatuanBesarActionPerformed

private void mnItemSatuanKecilActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemSatuanKecilActionPerformed
// TODO add your handling code here:
    frmSatuanKecil frmsatuankecil = new frmSatuanKecil();
    frmsatuankecil.setVisible(true);
}//GEN-LAST:event_mnItemSatuanKecilActionPerformed

private void mnItemStokBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemStokBarangActionPerformed
// TODO add your handling code here:
    frmStokBarang frmstokbarang = new frmStokBarang();
    frmstokbarang.setVisible(true);
}//GEN-LAST:event_mnItemStokBarangActionPerformed

private void mnItemResepKaryawanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemResepKaryawanActionPerformed
// TODO add your handling code here:
    frmPelayananResepKaryawan frmresepkaryawan = new frmPelayananResepKaryawan();
    frmresepkaryawan.setVisible(true);
}//GEN-LAST:event_mnItemResepKaryawanActionPerformed

private void mnItemResepLuarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemResepLuarActionPerformed
// TODO add your handling code here:
    frmPelayananResepLuar frmresepluar = new frmPelayananResepLuar();
    frmresepluar.setVisible(true);
}//GEN-LAST:event_mnItemResepLuarActionPerformed

private void mnItemResepPasienActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemResepPasienActionPerformed
// TODO add your handling code here:
    frmPelayananResepPasien frmreseppasien = new frmPelayananResepPasien();
    frmreseppasien.setVisible(true);
}//GEN-LAST:event_mnItemResepPasienActionPerformed

private void mnItemPemesananActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemPemesananActionPerformed
// TODO add your handling code here:
    frmPemesananKeSupplier frmpemesanansupplier = new frmPemesananKeSupplier();
    frmpemesanansupplier.setVisible(true);
}//GEN-LAST:event_mnItemPemesananActionPerformed

private void mnItemPenerimaanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemPenerimaanActionPerformed
// TODO add your handling code here:
    frmPenerimaanSupplier frmpenerimaansupplier = new frmPenerimaanSupplier();
    frmpenerimaansupplier.setVisible(true);
}//GEN-LAST:event_mnItemPenerimaanActionPerformed

private void mnItemPengirimanBarangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemPengirimanBarangActionPerformed
// TODO add your handling code here:
    frmPengirimanBarangKeRuangan frmpengirimanbarangruangan = new frmPengirimanBarangKeRuangan();
    frmpengirimanbarangruangan.setVisible(true);
}//GEN-LAST:event_mnItemPengirimanBarangActionPerformed

private void mnItemInfoPengirimanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemInfoPengirimanActionPerformed
// TODO add your handling code here:
    frmInformasiPengirimanBarangRuangan frminfopengirimanruangan = new frmInformasiPengirimanBarangRuangan();
    frminfopengirimanruangan.setVisible(true);
    
}//GEN-LAST:event_mnItemInfoPengirimanActionPerformed

private void mnItemLogoutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemLogoutActionPerformed
// TODO add your handling code here:
    setAuthentication(false);
}//GEN-LAST:event_mnItemLogoutActionPerformed

private void mnItemInfoResepKaryawanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnItemInfoResepKaryawanActionPerformed
// TODO add your handling code here:
    frmInformasiResepKaryawan frminforesepkar = new frmInformasiResepKaryawan();
    frminforesepkar.setVisible(true);
}//GEN-LAST:event_mnItemInfoResepKaryawanActionPerformed

private void mnInfoResepLuarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnInfoResepLuarActionPerformed
// TODO add your handling code here:
    frmInformasiResepLuar frminforesepluar = new frmInformasiResepLuar();
    frminforesepluar.setVisible(true);
}//GEN-LAST:event_mnInfoResepLuarActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMenu5;
    private javax.swing.JMenu jMenu6;
    private javax.swing.JMenu jMenu7;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JPopupMenu.Separator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    private javax.swing.JMenu mnBantuan;
    private javax.swing.JMenu mnDataMaster;
    private javax.swing.JMenu mnFile;
    private javax.swing.JMenuItem mnInfoResepLuar;
    private javax.swing.JMenu mnInformasi;
    private javax.swing.JMenuItem mnItemBantuanProgram;
    private javax.swing.JMenuItem mnItemDataBarang;
    private javax.swing.JMenuItem mnItemDataPasien;
    private javax.swing.JMenuItem mnItemInfoPemesanan;
    private javax.swing.JMenuItem mnItemInfoPenerimaan;
    private javax.swing.JMenuItem mnItemInfoPengiriman;
    private javax.swing.JMenuItem mnItemInfoResepKaryawan;
    private javax.swing.JMenuItem mnItemJenisBarang;
    private javax.swing.JMenuItem mnItemKeluar;
    private javax.swing.JMenuItem mnItemLogin;
    private javax.swing.JMenuItem mnItemLogout;
    private javax.swing.JMenuItem mnItemPemesanan;
    private javax.swing.JMenuItem mnItemPenerimaan;
    private javax.swing.JMenuItem mnItemPengirimanBarang;
    private javax.swing.JMenuItem mnItemResepKaryawan;
    private javax.swing.JMenuItem mnItemResepLuar;
    private javax.swing.JMenuItem mnItemResepPasien;
    private javax.swing.JMenuItem mnItemSatuanBesar;
    private javax.swing.JMenuItem mnItemSatuanKecil;
    private javax.swing.JMenuItem mnItemStokBarang;
    private javax.swing.JMenuItem mnItemTentangProgram;
    private javax.swing.JMenu mnTransaksi;
    private SIMRS.Apotek.widget.PnlHome pnlHome1;
    // End of variables declaration//GEN-END:variables

public void setAuthentication(boolean value) {
      //  mnFile.setEnabled(value);
       mnDataMaster.setEnabled(value);
       mnTransaksi.setEnabled(value);
       mnInformasi.setEnabled(value);
       mnBantuan.setEnabled(value);
        if (value==true) {
            mnItemLogin.setEnabled(false);
            mnItemLogout.setEnabled(true);
            
        } else {
            mnItemLogin.setEnabled(true);
            mnItemLogout.setEnabled(false);
            
        }
}
}
